8
n8n 中文网amn8n.com

我的工作流

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 32 个节点。主要使用 Set, Wait, Limit, Filter, SplitOut 等节点。 使用 Apify、GPT-4o 和 Facebook 广告库进行竞争广告研究与图像生成

前置要求
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "7a58a3f07a0fc2e793cb37fe49f8ad79d79b1752ef823a6ac87ff5a79f5b1fc9",
    "templateCredsSetupCompleted": true
  },
  "name": "我的工作流",
  "tags": [
    {
      "id": "ayzol4JLAXjiRLWi",
      "name": "N8N Course",
      "createdAt": "2025-07-19T07:19:09.524Z",
      "updatedAt": "2025-07-19T07:19:09.524Z"
    }
  ],
  "nodes": [
    {
      "id": "95c7569d-ff47-43dc-86bf-d746783da7a2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1216,
        288
      ],
      "parameters": {
        "width": 400,
        "height": 200,
        "content": "## 📱 步骤1:Facebook广告库数据抓取"
      },
      "typeVersion": 1
    },
    {
      "id": "4b67c4ce-e808-44ba-95d3-0bd0e59b79d6",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        16
      ],
      "parameters": {
        "width": 420,
        "height": 200,
        "content": "## 🏗️ 步骤2:Google Drive组织管理"
      },
      "typeVersion": 1
    },
    {
      "id": "e1b8e8a3-fc7d-440a-b509-1022dab42f79",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1216,
        640
      ],
      "parameters": {
        "width": 400,
        "height": 200,
        "content": "## 🤖 步骤3:AI分析与提示生成"
      },
      "typeVersion": 1
    },
    {
      "id": "cf8f11fc-6c4c-4a98-9875-433a19c646fc",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        976
      ],
      "parameters": {
        "width": 420,
        "height": 220,
        "content": "## 🎨 步骤4:AI图片生成与存储"
      },
      "typeVersion": 1
    },
    {
      "id": "72e1f19f-15b4-4f13-bd7e-5e52bcc01e25",
      "name": "当点击“执行工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -656,
        32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a76ca1c3-285c-4840-a390-d7204585407b",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -448,
        32
      ],
      "parameters": {
        "name": "PPC Thievery",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        },
        "resource": "folder"
      },
      "typeVersion": 3
    },
    {
      "id": "5116f412-d0f3-4aaa-a95c-516bae884d88",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        -128
      ],
      "parameters": {
        "color": 6,
        "width": 1140,
        "height": 340,
        "content": "## 1. 运行一次创建文件夹和数据库"
      },
      "typeVersion": 1
    },
    {
      "id": "aef6590c-937a-4bc7-a248-24dc41639a20",
      "name": "过滤器",
      "type": "n8n-nodes-base.filter",
      "position": [
        80,
        464
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "00a1c88b-d177-4862-b82c-6dc1ce4291f7",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.snapshot.images[0].original_image_url }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "409aaa70-34ae-45d8-8d62-5065a8a389e6",
      "name": "运行广告库抓取器",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -160,
        464
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/XtaWFhbtfxyzqrFmd/run-sync-get-dataset-items",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "{\n    \"count\": 20,\n    \"period\": \"last7d\",\n    \"scrapeAdDetails\": true,\n    \"scrapePageAds.activeStatus\": \"active\",\n    \"urls\": [\n        {\n            \"url\": \"https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&is_targeted_country=false&media_type=all&q=agency&search_type=keyword_unordered\",\n            \"method\": \"GET\"\n        }\n    ]\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "Bearer <your-apify-api-key-here>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3ea9c85f-e228-4278-bcda-d989fd98707c",
      "name": "限制",
      "type": "n8n-nodes-base.limit",
      "position": [
        288,
        464
      ],
      "parameters": {
        "maxItems": 2
      },
      "typeVersion": 1
    },
    {
      "id": "4ca3f2d9-9036-469c-af6f-377ee7266659",
      "name": "Google Drive 1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1392,
        464
      ],
      "parameters": {
        "name": "={{ $binary.data.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "e6725a15-9250-4262-8bc2-303ab6e1ca05",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -400,
        656
      ],
      "parameters": {
        "text": "What's in this image? Describe it extremely comprehensively. Leave nothing out.",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {},
        "resource": "image",
        "imageUrls": "=https://drive.google.com/uc?export=download&id={{ $('Google Drive1').item.json.id }}",
        "operation": "analyze"
      },
      "typeVersion": 1.8
    },
    {
      "id": "adfd39a4-0845-42c6-82a4-2d953da97e52",
      "name": "Google Drive 2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -608,
        656
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "writer",
            "type": "anyone"
          }
        }
      },
      "typeVersion": 3
    },
    {
      "id": "9e54072b-0208-4755-bb41-ce82907b202b",
      "name": "设置变量",
      "type": "n8n-nodes-base.set",
      "position": [
        -368,
        464
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "402a3a15-e71a-4a1b-b235-31edd676d59b",
              "name": "googleDriveFolderId",
              "type": "string",
              "value": "1O_Uh4uvtqU9C9ntk9Rk-B2XhMLYxg_1Z"
            },
            {
              "id": "91e9cf54-7a74-4255-a322-44096d3e3af3",
              "name": "changeRequest",
              "type": "string",
              "value": "Spin this ad so that it features a minimalistic, pastel design. If there is any text on the page replace it with something like \"Upgrade your systems today\" or \"Get your flows optimized today\". If there are any assets on the page leave them as-is. Add a company name, LeftClick, in the bottom right hand corner, along with a little stylized mouse pointer icon."
            },
            {
              "id": "d3bd4796-3be4-4925-9467-e0f8ab2d6573",
              "name": "spreadsheetId",
              "type": "string",
              "value": "1-R45sKQJidkfffSwYAPsI-OLL-4CKSdYXIDkKfdcTVg"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3994acec-9182-4085-ad98-d16bf19ba2b4",
      "name": "衍生提示",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -176,
        656
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "GPT-4.1"
        },
        "options": {
          "temperature": 0.7
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You're a helpful, intelligent prompt rewriting assistant. You help rewrite prompts."
            },
            {
              "content": "=I've generated an image description. I want you to take that image description and then give me a simple \"change request\" prompt I can use to tell an AI image editor what changes to make.\n\nReturn your output in the following JSON format:\n\n{\"variants\":[\"First change request\", \"Second change request\", \"Third change request\", \"etc\"]}\n\nRules:\n- Your task is to generate *new* change suggestions that we will later feed into an image generation model.\n- Changes you can make: font style (serif, sans-serif, display), font size, font leading, font tracking, font color, saturation, brightness, background color, background patterns, design style (flat, minimalistic, sleek, photoreal, etc—go nuts here), colors of assets on the page, swapping one asset for another that is more related to the change request.\n- Make these changes reasonable—we want to stick to the source pretty closely. Do not suggest any meaningful changes to the placement of assets. We want the elements all in the exact same place in the image, so only ever suggest color, style, asset type, font type, or copy changes.\n- Use the provided company name in the change request—never the original company name.\n- Generate 3 variants. No more, no less.\n- Adjust the copy so that it's relevant to an audience that wants \"AI automation\". Also make sure your generated copy is similar in length to the copy of the original.\n"
            },
            {
              "content": "{\"originalDescription\":\"The image features a promotional graphic with a bright blue background. Centered on the left is a layered design element consisting of two images. The top image shows a person sitting with a laptop, smiling, wearing a white jacket and blue jeans, with a background of green leaves and plants. Below this image is what appears to be a partially visible document with text and a table. \\n\\nSuperimposed at the top of the image is a white download arrow icon. Beneath the images, the text reads, \"Change your practice management software,\" in bold white lettering, with the words partially highlighted by a darker blue rectangle. This suggests a call to action or advertisement for software related to practice management.\", \"changeRequest\":\"Make it a soft, pastel orange; change text to something like 'Upgrade your systems today'. LeftClick logo with a mouse pointer icon (bottom right)\"}"
            },
            {
              "role": "assistant",
              "content": "{\"variants\":[\n  \"Make the background bright orange, swap the text for 'Upgrade your systems today', change it to sans-serif. Add a LeftClick logo with a mouse pointer icon positioned in the bottom right corner. Slightly more upscale style.\",\n  \"Switch the background to a clean white. Update the headline to say 'Optimize with LeftClick.' and clean, minimalistic serif font. Place the LeftClick logo and a minimalist arrow cursor icon in the top-left corner.\",\n  \"Set the background to a gradient from deep blue to turquoise. Change the text to 'Smarter systems start here.', play with the leading and tracking and make it a standout display font. Keep the LeftClick logo in the bottom right, but make it semi-transparent.\",\n  \"Use a charcoal grey background with high-contrast white text that says 'LeftClick powers performance.' Include a small pointer icon beside the logo in the bottom center.\",\n  \"Make the background electric lime green. Replace the message with 'Your automation partner: LeftClick.' Mouse pointer icon next to the logo in the lower-right, make the fonts hyper stylized.\"\n]\n}"
            },
            {
              "content": "={\"originalDescription\":\"{{ $json.content }}\", \"changeRequest\":\"{{ $('Set Variables').item.json.changeRequest }}\"} "
            }
          ]
        },
        "jsonOutput": true
      },
      "typeVersion": 1.8
    },
    {
      "id": "24ae679c-9a77-4d48-bf22-31318a716aea",
      "name": "使用 GPT 图像生成图像 1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1072,
        656
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/images/edits",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "image[]",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            },
            {
              "name": "prompt",
              "value": "=Your task is to generate an image.\n\nHere is your prompt:\n\n{{ $('Loop Over Items').item.json.variant }}\n\nRules:\n- Stick as closely as possible to the outlines of the source document.\n- Change text, colors, shapes, and styles only if explicitly specified in the prompt. If something is not specified, do not change it.\n- If there is an actor and no style is specified, change the way they look a little so it's not the same actor. Only do this if the desired style is not a rendered, drawing, or cartoon version of them."
            },
            {
              "name": "size",
              "value": "1024x1024"
            }
          ]
        },
        "nodeCredentialType": "openAiApi"
      },
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "c4909154-ea7d-47ae-88a3-323d0cee9f02",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        608,
        656
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "407e8a41-6fac-4f36-af80-494869e305e2",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        1952,
        656
      ],
      "webhookId": "e0023d56-efc1-4a82-b312-bc27f4ff837b",
      "parameters": {
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "84161f30-a19c-48c5-aca1-6bfa4cf1f8f5",
      "name": "分离输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        192,
        656
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "message.content.variants"
      },
      "typeVersion": 1
    },
    {
      "id": "f08995f3-d795-4124-aad4-85d778d2e8ad",
      "name": "编辑字段",
      "type": "n8n-nodes-base.set",
      "position": [
        416,
        656
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "de128b60-4a0b-4736-876b-4bef0add0478",
              "name": "variant",
              "type": "string",
              "value": "={{ $json[\"message.content.variants\"] }}"
            },
            {
              "id": "6aa78def-4707-408a-8e9f-9c8b8fbe9381",
              "name": "imageAdUrl",
              "type": "string",
              "value": "={{ $('Filter').item.json.snapshot.images[0].original_image_url }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3a6dc4a2-39e9-4281-b34b-944df22a4d6f",
      "name": "下载静态图片广告1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        832,
        656
      ],
      "parameters": {
        "url": "={{ $json.imageAdUrl }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "3c845061-f894-4528-aafb-0bd8679086b1",
      "name": "转换为文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1296,
        656
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json"
      },
      "typeVersion": 1.1
    },
    {
      "id": "8c676162-4a03-4196-86ae-3d6a4e18ea68",
      "name": "Google Drive3",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1520,
        656
      ],
      "parameters": {
        "name": "={{ $('Google Drive1').item.json.name }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "6b856ae9-3709-4355-a57e-d8da62d3a041",
      "name": "创建资产父文件夹",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        512,
        464
      ],
      "parameters": {
        "name": "={{ $json.ad_archive_id }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Variables').item.json.googleDriveFolderId }}"
        },
        "resource": "folder"
      },
      "typeVersion": 3
    },
    {
      "id": "e802aa82-181f-40d5-ab3c-c0b270740979",
      "name": "创建子源文件夹",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        736,
        464
      ],
      "parameters": {
        "name": "=1. Source Assets",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{$json.id}}"
        },
        "resource": "folder"
      },
      "typeVersion": 3
    },
    {
      "id": "fe7a9a94-e0cd-4a35-9666-f07447775abc",
      "name": "创建子衍生文件夹",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        928,
        464
      ],
      "parameters": {
        "name": "=2. Spun Assets",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create Asset Parent Folder').item.json.id }}"
        },
        "resource": "folder"
      },
      "typeVersion": 3
    },
    {
      "id": "6c06d975-dbce-4111-933e-8193e0f3cb45",
      "name": "下载静态图片广告",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1168,
        464
      ],
      "parameters": {
        "url": "={{ $('Run Ad Library Scraper').item.json.snapshot.images[0].original_image_url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "543a3114-31f6-4f87-a1bc-f7c0d8160099",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1728,
        656
      ],
      "parameters": {
        "columns": {
          "value": {
            "ad_body": "={{ $('Run Ad Library Scraper').item.json.snapshot.body.text }}",
            "page_id": "={{ $('Run Ad Library Scraper').item.json.page_id }}",
            "page_name": "={{ $('Run Ad Library Scraper').item.json.page_name }}",
            "timestamp": "={{ $now.toSeconds() }}",
            "spun_folder": "=https://drive.google.com/drive/u/0/folders/{{ $('Create Child Spun Folder').item.json.id }}",
            "asset_folder": "=https://drive.google.com/drive/u/0/folders/{{ $('Create Asset Parent Folder').item.json.id }}",
            "date_scraped": "={{ $('Run Ad Library Scraper').item.json.start_date }}",
            "spun_prompts": "={{ $('Download Static Image Ad1').item.json.variant }}",
            "ad_archive_id": "={{ $('Run Ad Library Scraper').item.json.ad_archive_id }}",
            "source_folder": "=https://drive.google.com/drive/u/0/folders/{{ $('Create Child Source Folder').item.json.id }}",
            "original_image_url": "={{ $('Run Ad Library Scraper').item.json.snapshot.images[0].original_image_url }}",
            "direct_spun_image_link": "={{ $json.webViewLink }}"
          },
          "schema": [
            {
              "id": "timestamp",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ad_archive_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ad_archive_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "original_image_url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "original_image_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ad_body",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ad_body",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date_scraped",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "date_scraped",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "spun_prompts",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "spun_prompts",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "asset_folder",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "asset_folder",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "source_folder",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "source_folder",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "spun_folder",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "spun_folder",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "direct_spun_image_link",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "direct_spun_image_link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "scraped_ads"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Variables').item.json.spreadsheetId }}"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "7ac56ea5-37b8-40ca-b177-68fbf84f4550",
      "name": "Google Sheets1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -240,
        32
      ],
      "parameters": {
        "title": "PPC Thievery",
        "options": {},
        "resource": "spreadsheet",
        "sheetsUi": {
          "sheetValues": [
            {
              "title": "scraped_ads"
            }
          ]
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "9cd0a069-4728-4975-b699-596f5794a6b9",
      "name": "Google Sheets2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        208,
        32
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "timestamp",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ad_archive_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ad_archive_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "original_image_url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "original_image_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ad_body",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ad_body",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date_scraped",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "date_scraped",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "spun_prompts",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "spun_prompts",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "asset_folder",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "asset_folder",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "source_folder",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "source_folder",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "spun_folder",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "spun_folder",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "direct_spun_image_link",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "direct_spun_image_link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "scraped_ads"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Google Sheets1').item.json.spreadsheetId }}"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "93b2d8d7-a122-4a75-8bcd-7dd1bee31f5d",
      "name": "编辑字段1",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "298bd00b-3410-47ec-95eb-af379f2966fa",
              "name": "timestamp",
              "type": "string",
              "value": ""
            },
            {
              "id": "c922e090-09cf-40b0-8787-b89f63af41c3",
              "name": "ad_archive_id",
              "type": "string",
              "value": ""
            },
            {
              "id": "854139e6-2696-4039-95d0-33d62b413dcb",
              "name": "page_id",
              "type": "string",
              "value": ""
            },
            {
              "id": "c9422756-a649-403b-b080-38a2c6ef66d7",
              "name": "original_image_url",
              "type": "string",
              "value": ""
            },
            {
              "id": "8a3c6e68-9f8d-4955-a10b-81b24a7296c5",
              "name": "page_name",
              "type": "string",
              "value": ""
            },
            {
              "id": "6bcc6c5d-4115-4ca4-bdb4-08458a3764ba",
              "name": "ad_body",
              "type": "string",
              "value": ""
            },
            {
              "id": "fe4e7b13-f9ca-4684-8fc2-824a33fe8cb5",
              "name": "date_scraped",
              "type": "string",
              "value": ""
            },
            {
              "id": "28d2210d-1bf8-40cd-bde6-201bdc62b2c0",
              "name": "spun_prompts",
              "type": "string",
              "value": ""
            },
            {
              "id": "d8f16995-1d73-42da-b7f0-fb9cfb974ea0",
              "name": "asset_folder",
              "type": "string",
              "value": ""
            },
            {
              "id": "9323586a-7d73-4c22-978d-30f4f35b11d0",
              "name": "source_folder",
              "type": "string",
              "value": ""
            },
            {
              "id": "64abb9e9-2d0f-4120-b1dc-f0a349815223",
              "name": "spun_folder",
              "type": "string",
              "value": ""
            },
            {
              "id": "1a580ae0-0004-4b6a-85ae-23aa96e30ec8",
              "name": "direct_spun_image_link",
              "type": "string",
              "value": ""
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5d48773d-77d7-43a9-a362-ef2fb77d861b",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        288
      ],
      "parameters": {
        "color": 6,
        "width": 2860,
        "height": 620,
        "content": "## 2. 更新\"设置变量\"和\"运行广告库抓取器\"并运行。"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Create Asset Parent Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Spin Prompts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Google Sheets2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Spin Prompts": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive1": {
      "main": [
        [
          {
            "node": "Google Drive2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive2": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive3": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Variables": {
      "main": [
        [
          {
            "node": "Run Ad Library Scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets1": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Google Drive3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Download Static Image Ad1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Ad Library Scraper": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Child Spun Folder": {
      "main": [
        [
          {
            "node": "Download Static Image Ad",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Static Image Ad": {
      "main": [
        [
          {
            "node": "Google Drive1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Static Image Ad1": {
      "main": [
        [
          {
            "node": "Generate Image Using GPT Image 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Asset Parent Folder": {
      "main": [
        [
          {
            "node": "Create Child Source Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Child Source Folder": {
      "main": [
        [
          {
            "node": "Create Child Spun Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image Using GPT Image 1": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 内容创作, 多模态 AI

需要付费吗?

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

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

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

作者
Nick Saraev

Nick Saraev

@nicksaraev

Hi 👋 I'm Nick. I make money with automation & teach others how they can too. If you have any questions about my templates or about my n8n builds, feel free to ask and I'll happily respond in the comments. Thanks for reading!

外部链接
在 n8n.io 查看

分享此工作流