8
n8n 中文网amn8n.com

使用OpenAI和Firecrawl从产品URL创建AI生成的Meta广告活动

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 40 个节点。主要使用 If, Set, Code, Wait, Merge 等节点。 使用OpenAI和Firecrawl从产品URL创建AI生成的Meta广告活动

前置要求
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "2d54f61dfd963457efb86a8690aae457934e92fb9e4b8b6490ca74fc37094458",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "7fe8fca7-cfaa-4d8d-9d5b-e7a8e288ea21",
      "name": "拆分",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1504,
        400
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c2d0dc8d-4f93-4879-a8e8-90893a866627",
      "name": "平台适配器",
      "type": "n8n-nodes-base.code",
      "position": [
        1728,
        400
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "5d1715b4-9077-4193-a62a-6e01ec9197fb",
      "name": "批处理",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1952,
        400
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "9c4f6edb-e4ed-4ad4-9353-c4bb6a4d333d",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        2176,
        400
      ],
      "webhookId": "f95ca634-9e19-4f64-90ae-9534420fb588",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "e782f17b-56eb-4b06-8019-42bcc10985dc",
      "name": "AI广告表单提交",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -640,
        400
      ],
      "webhookId": "98225ca9-5e82-4b04-b650-2c211fe99fe2",
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "09ebd976-f855-46b2-9f33-343811c7117c",
      "name": "OpenAI生成图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2400,
        400
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "ff2bdaaf-b7e0-4480-a72c-0d002df0c0d8",
      "name": "Base64字符串转文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        2608,
        400
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "335aa491-31e3-451e-9f8c-b4ebf5db0337",
      "name": "创意简报",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        704,
        400
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 1.8
    },
    {
      "id": "4d2625d2-937d-4ae8-8364-ed11e4b35eba",
      "name": "抓取URL并获取其内容",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "position": [
        -416,
        400
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "31186bf1-30aa-4f06-bd38-0e3e0ac14244",
      "name": "OpenAI聊天模型2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -128,
        624
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "5bf6f5c1-ced8-43e0-a594-b6224923dbba",
      "name": "结构化输出解析器1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -112,
        416
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "7e523dfe-1b4d-487f-840f-7b59c7b2624f",
      "name": "使用JSON Schema的OpenAI提取",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -192,
        192
      ],
      "parameters": {},
      "typeVersion": 1.7
    },
    {
      "id": "9934ff53-b1df-4a6d-af05-8c5cdf66cdd4",
      "name": "分析产品1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        256,
        336
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 1.8
    },
    {
      "id": "73772c53-591a-4077-ae95-a9de6c11a292",
      "name": "合并1",
      "type": "n8n-nodes-base.merge",
      "position": [
        480,
        400
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "b43d3e4c-18ef-4ab1-ae56-ae7d86407b7d",
      "name": "上传视频到FB",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2640,
        -48
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "14bc464d-fbe0-40f6-93d0-db5cc93d2dea",
      "name": "创建视频创意",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3088,
        -48
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "6347fd71-1c54-45ca-aca1-9808e83957c6",
      "name": "是否为视频?",
      "type": "n8n-nodes-base.if",
      "onError": "continueRegularOutput",
      "position": [
        2416,
        48
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "12701458-ef9c-49ab-9693-58e5bc5deb64",
      "name": "上传图片到FB",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2640,
        144
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "dbb427ce-086c-49e9-af06-3fe6945a5548",
      "name": "创建图片创意",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3088,
        144
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "b448342b-c28e-4f08-9b7f-c94db3819007",
      "name": "合并创意",
      "type": "n8n-nodes-base.merge",
      "position": [
        3536,
        48
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "903c7389-6ccf-40a2-a00a-f07332c461d0",
      "name": "创建广告系列",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3984,
        128
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "07b32a52-221e-46c1-96c2-c98d290e23a2",
      "name": "运行一次",
      "type": "n8n-nodes-base.function",
      "position": [
        3760,
        128
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "85eb6948-f9bf-462e-9eab-771e3388a896",
      "name": "创建广告组",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4208,
        128
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "13831042-6416-47cb-943d-1e8277772842",
      "name": "创建广告",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4880,
        48
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "8c4e43cc-51d0-4cd8-a119-671c83bdcd72",
      "name": "设置视频ID",
      "type": "n8n-nodes-base.set",
      "position": [
        2864,
        -48
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "90fd180b-c721-45c6-aa7a-04699324406f",
      "name": "设置图片哈希",
      "type": "n8n-nodes-base.set",
      "position": [
        2864,
        144
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "b163005b-df59-454b-9bca-468ffaee37f8",
      "name": "设置图片包",
      "type": "n8n-nodes-base.set",
      "position": [
        3312,
        144
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "cc88d7b9-a422-45f7-bc56-ae22fa5d49e9",
      "name": "设置视频包",
      "type": "n8n-nodes-base.set",
      "position": [
        3312,
        -48
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "ccbf6a4d-d8b3-4e22-8cfb-c2ffd99633a2",
      "name": "保存广告组ID",
      "type": "n8n-nodes-base.set",
      "position": [
        4432,
        128
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "006ac537-2bfe-449a-838d-2fa5d0d2b9f2",
      "name": "合并2",
      "type": "n8n-nodes-base.merge",
      "position": [
        4656,
        48
      ],
      "parameters": {},
      "typeVersion": 3.1
    },
    {
      "id": "ebb8027e-8121-4b6c-a355-c1de7dc2e3f4",
      "name": "Meta广告配置",
      "type": "n8n-nodes-base.set",
      "position": [
        2192,
        48
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "92aab71c-b361-4afd-b7c5-d46d46a8b196",
      "name": "GPT-4模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1136,
        624
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "487deec6-6e2f-4b9d-bfc4-061e62cdcbf9",
      "name": "输出解析器1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1136,
        416
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "3e904ef5-1f95-49a3-b3e4-48fa426bbd2d",
      "name": "生成广告活动",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1056,
        192
      ],
      "parameters": {},
      "typeVersion": 1.9
    },
    {
      "id": "4fc5d55c-45fc-4521-9f57-e7e5ba977e9d",
      "name": "编辑字段",
      "type": "n8n-nodes-base.set",
      "position": [
        2832,
        400
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "f8308103-624c-47f2-94d0-8fbc9d222189",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "1e46640c-a9e9-479c-b0e2-6e480a4ccd5f",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        784
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "1140b891-81dd-4e51-b2b7-00b8843e87be",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        -80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d5ae1462-dd0e-4fbd-9dac-edbacfa8ba8a",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1984,
        656
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "31de7168-a3f9-4036-b28a-9c9d32c3fc0b",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3088,
        -352
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Open AI Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Batch": {
      "main": [
        [
          {
            "node": "Configuration Meta Ads",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split": {
      "main": [
        [
          {
            "node": "Platform Adapter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Creative Brief",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge2": {
      "main": [
        [
          {
            "node": "Create Ad",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Once": {
      "main": [
        [
          {
            "node": "Create Campaign",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Ad": {
      "main": [
        []
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Batch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4 Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Ad Camp",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Output Parser1",
            "type": "ai_languageModel",
            "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": "Merge2",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Creative Brief": {
      "main": [
        [
          {
            "node": "Generate Ad Camp",
            "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
          }
        ]
      ]
    },
    "Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Ad Camp",
            "type": "ai_outputParser",
            "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": "Merge2",
            "type": "main",
            "index": 0
          },
          {
            "node": "Run Once",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Product1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Ad Camp": {
      "main": [
        [
          {
            "node": "Split",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Platform Adapter": {
      "main": [
        [
          {
            "node": "Batch",
            "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
          }
        ]
      ]
    },
    "B64 String to File": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "OpenAI extraction with JSON Schema",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output Parser1",
            "type": "ai_languageModel",
            "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
          }
        ]
      ]
    },
    "AI Ad Form Submission": {
      "main": [
        [
          {
            "node": "Scrape a url and get its content",
            "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": "Is it a Video?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Open AI Generate Image": {
      "main": [
        [
          {
            "node": "B64 String to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "OpenAI extraction with JSON Schema",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Scrape a url and get its content": {
      "main": [
        [
          {
            "node": "OpenAI extraction with JSON Schema",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI extraction with JSON Schema": {
      "main": [
        [
          {
            "node": "Analyze Product1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
Adam Crafts

Adam Crafts

@adamcrafts

As an experienced AI Agent Builder, I specialize in creating intelligent solutions tailored to enhance automation, streamline operations, and drive innovation. 🛠️ My passion lies in transforming ideas into functional AI agents that deliver tangible results.

外部链接
在 n8n.io 查看

分享此工作流