8
n8n 中文网amn8n.com

营销内容创建

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 40 个节点。主要使用 If, Set, Switch, Telegram, HttpRequest 等节点。 使用Telegram和Gemini从图像生成Facebook营销内容

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "ZIWg65Fq4Vr1rkBF",
  "meta": {
    "instanceId": "7f1a0694161455be3a7e71f1e0dea04908b0376a1a81e3a0c1e5ac879d48f83a",
    "templateCredsSetupCompleted": true
  },
  "name": "营销内容创建",
  "tags": [],
  "nodes": [
    {
      "id": "e790ce12-84f5-4a14-84b7-2cca94a2c2ce",
      "name": "从 Telegram 触发",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -4272,
        -368
      ],
      "webhookId": "fc2cd6f7-52fb-47e1-a95e-60b8a7f023bf",
      "parameters": {
        "updates": [
          "*"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "54Wv2uMARWE0XAUl",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3fdb47aa-c20d-4d64-ba2d-9e7004c6fdf4",
      "name": "提取 Telegram 元数据",
      "type": "n8n-nodes-base.set",
      "position": [
        -4016,
        -368
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "516ee90b-f268-45a4-b445-3245fb0da83e",
              "name": "photo_file_id",
              "type": "string",
              "value": "={{ $json.message.photo[3].file_id }}"
            },
            {
              "id": "2008723e-9991-4e7a-b1d2-cbb4876adac8",
              "name": "photo_caption",
              "type": "string",
              "value": "={{$json[\"message\"][\"caption\"] || \"No caption provided\"}}"
            },
            {
              "id": "38ea22ee-878a-4d16-bad4-d178edde481e",
              "name": "chat_id",
              "type": "string",
              "value": "={{$json[\"message\"][\"chat\"][\"id\"]}}"
            },
            {
              "id": "9eb27912-af87-462f-a324-16ec084df841",
              "name": "message_id",
              "type": "string",
              "value": "={{$json[\"message\"][\"message_id\"]}}"
            },
            {
              "id": "f3f7a986-e9e1-45f0-ac79-44cda0dc32ec",
              "name": "timestamp",
              "type": "string",
              "value": "={{new Date().toISOString()}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c634c46a-a9a9-4cd6-b161-fee6a2819f8e",
      "name": "获取 Telegram 文件信息",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3824,
        -368
      ],
      "parameters": {
        "url": "=https://api.telegram.org/{{TELEGRAM_BOT_TOKEN}}/getFile?file_id={{$json[\"photo_file_id\"]}}",
        "options": {}
      },
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "a7417e16-1a71-42ce-97c8-9ae7d1dc7535",
      "name": "构建 Telegram 图片 URL",
      "type": "n8n-nodes-base.set",
      "position": [
        -3648,
        -368
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e84d0249-e55f-4099-9144-4c22598682db",
              "name": "file_path",
              "type": "string",
              "value": "={{ $json.result.file_path }}"
            },
            {
              "id": "9d23e1a9-80fe-45bb-a96f-7f7652237cf8",
              "name": "download_url",
              "type": "string",
              "value": "=https://api.telegram.org/file/bot[YOUR_BOT_TOKEN]/{{$json[\"result\"][\"file_path\"]}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d3d8a354-a650-4941-87e2-4755060b48a8",
      "name": "下载 Telegram 图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3440,
        -368
      ],
      "parameters": {
        "url": "={{ $json.download_url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "=photo_data"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e1d82b9b-f1bf-40c6-8b3c-1d44c0bb12a7",
      "name": "生成营销内容",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -3248,
        -368
      ],
      "parameters": {
        "text": "=You are the content creator for XQ Pharma—a skincare brand dedicated to real, visible results for young, modern consumers in the Arab world.\n\nYour job is to write:\n\nA strong hook: A short, catchy sentence that starts with a real problem or clear benefit, instantly grabbing attention.\n\nConcise, convincing content: 3–5 sentences that explain the product or routine, what makes it different, and how it truly helps the customer (no complicated medical jargon, no exaggeration).\n\nA call-to-action (CTA): A direct, friendly invitation to try, buy, or start the routine.\n\nRequired Style & Tone:\n\nYouthful, conversational, and down-to-earth—not formal or generic\n\nSpeak directly to the customer's needs and struggles\n\nFocus on how the product makes life easier, skin clearer, and confidence higher\n\nAvoid clichés or over-the-top claims—keep it real, keep it simple\n\nUse language and phrases that feel local, relatable, and fresh\n\nStructure:\n\nHook: One catchy line that starts with the customer’s struggle or promises a real change\n\nBody: 3–5 sentences explaining the true benefit and role of the product or routine—why XQ makes a difference\n\nCTA: End with a clear, friendly, motivating invitation to try, buy, or experience XQ\n\nBrand Example Tone:\n\n“Wake up to new breakouts every day? Leave them behind and start your XQ routine—for calmer, clearer skin!”\n\n“One wash… and real clarity that lasts.”\n\n“Every product has a role. Every step gives you real comfort and confidence.”\n\n“Try XQ and see the difference for yourself!”\n\nAlways write in clear, natural Arabic, true to XQ’s brand voice.\nDon’t recycle generic ad copy—each post must feel new, real, and close to your audience.\nMatch the brand’s look, feel, and promise in every line.\n\nOutput must be in this JSON format:\n{\n  \"headline\": \"...\",\n  \"content\": \"...\",\n  \"hashtags\": [\"...\", \"...\"],\n  \"cta\": \"...\"\n}\n\n\n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "95fc665a-c98a-4ce6-9d77-63a6deba8c81",
      "name": "语言模型 (OpenRouter)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -3248,
        -144
      ],
      "parameters": {
        "model": "google/gemini-2.5-flash-lite",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "id": "dlnlO0HAUYbEGXZE",
          "name": "OpenRouter account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "18dd5c2e-f93b-48a8-8fc0-f2653f18411a",
      "name": "解析AI输出",
      "type": "n8n-nodes-base.set",
      "position": [
        -2864,
        -368
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "91323867-f4bf-4bcc-a696-6524795e082f",
              "name": "headline",
              "type": "string",
              "value": "={{ JSON.parse($json[\"output\"].replace(/```json|```/g, \"\").trim()).headline }}\n"
            },
            {
              "id": "33d44685-8463-4730-8bb4-c1f006f6a466",
              "name": "content",
              "type": "string",
              "value": "={{ JSON.parse($json[\"output\"].replace(/```json|```/g, \"\").trim()).content }}\n"
            },
            {
              "id": "915dec92-ad74-423a-a81e-30b027100eb1",
              "name": "hashtags",
              "type": "string",
              "value": "={{ JSON.parse($json[\"output\"].replace(/```json|```/g, \"\").trim()).hashtags.join(\" \") }}\n"
            },
            {
              "id": "5c7cbab9-8090-436e-962f-6626f6855393",
              "name": "cta",
              "type": "string",
              "value": "={{ JSON.parse($json[\"output\"].replace(/```json|```/g, \"\").trim()).cta }}\n"
            },
            {
              "id": "73d4fbf5-9f22-4ec7-b4e3-64a89b2c726a",
              "name": "approval_id",
              "type": "string",
              "value": "=_{{Math.random().toString(36).substr(2, 9)}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "b3a68c66-f304-434e-8050-b34be7ea93d8",
      "name": "审批决策",
      "type": "n8n-nodes-base.if",
      "position": [
        -1904,
        -368
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "b86d09ef-20f0-40fa-be59-3a9900f20aa5",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": "="
            },
            {
              "id": "03978ad9-213f-4aeb-809e-c9b6fa0e0324",
              "operator": {
                "type": "boolean",
                "operation": "false",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2,
      "alwaysOutputData": false
    },
    {
      "id": "b48b0d1c-b5af-474b-a334-f00a56e08a50",
      "name": "检查消息是否有照片",
      "type": "n8n-nodes-base.if",
      "position": [
        -3760,
        48
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a93c60b8-3ddf-4ab0-bfe7-34b922b08533",
              "operator": {
                "type": "boolean",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.message.photo }}",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "b560bb97-68b0-4eb8-8709-c65b7f8753de",
      "name": "提示用户输入 (手动)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -2048,
        544
      ],
      "webhookId": "91d8157e-a213-4e90-ab4a-0cfbe193beca",
      "parameters": {
        "text": "What changes would you like ?",
        "chatId": "={{ $('Extract Telegram Metadata').item.json.chat_id }} ",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "54Wv2uMARWE0XAUl",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "96cbf7cb-89a4-42bd-9107-0d6e88eee868",
      "name": "使用用户文本重新启动工作流",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        -1840,
        544
      ],
      "parameters": {
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "{{REPLACE_WITH_SUB_WORKFLOW_ID}}",
          "cachedResultName": "{{Sub Workflow Name}}"
        },
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "246d08f7-d645-45cf-807a-b7d69d0689f9",
      "name": "再次重新启动工作流",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        -1456,
        80
      ],
      "parameters": {
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "{{REPLACE_WITH_SUB_WORKFLOW_ID}}",
          "cachedResultName": "{{Sub Workflow Name}}"
        },
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8cbbd214-3b3a-4aba-93cc-1e769847e789",
      "name": "发布帖子到 Facebook",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1664,
        -384
      ],
      "parameters": {
        "url": "https://graph.facebook.com/v12.0/{{PAGE_ID}}/photos",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "source",
              "value": "={{ $('Edit Fields1').item.json.file_path }}"
            },
            {
              "name": "message",
              "value": "={{ $('Switch1').item.json.headline }}\\n\\n{{ $('Switch1').item.json.content }}\\n\\n{{ $('Switch1').item.json.hashtags }}"
            },
            {
              "name": "published",
              "value": "true"
            }
          ]
        },
        "genericAuthType": "oAuth2Api"
      },
      "typeVersion": 4.2
    },
    {
      "id": "45c9e2cf-bbdd-4e09-9c62-240382f85921",
      "name": "通知 Facebook 成功",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1456,
        -384
      ],
      "webhookId": "7260ee50-b037-44d2-9036-7627e22c4b02",
      "parameters": {
        "text": "📅 Your post has been successfully scheduled for publishing on Facebook!",
        "chatId": "={{ $('Check if Message has Photo').item.json.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "54Wv2uMARWE0XAUl",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a05ff9fe-ddce-4c9a-bc28-407612de0c6b",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4368,
        -480
      ],
      "parameters": {
        "color": 3,
        "height": 256,
        "content": "当 Telegram 机器人收到用户的新消息(包括照片和文本)时启动工作流。"
      },
      "typeVersion": 1
    },
    {
      "id": "5850a31e-524e-4449-9a2d-cf8b9fc0f82b",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3824,
        -96
      ],
      "parameters": {
        "color": 4,
        "height": 320,
        "content": "确定传入的 Telegram 消息是否包含照片。路由到图像处理路径或纯文本消息的回退路径。"
      },
      "typeVersion": 1
    },
    {
      "id": "aeee1d5f-2744-4d23-a669-c46bca013a9a",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4080,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 208,
        "height": 256,
        "content": "从传入消息中提取关键字段,如 chat_id、file_id、caption 和 timestamp,以供进一步处理。"
      },
      "typeVersion": 1
    },
    {
      "id": "6d30b34a-8052-4772-9c03-2f13dcde46fd",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3856,
        -480
      ],
      "parameters": {
        "color": 4,
        "width": 160,
        "height": 256,
        "content": "调用 Telegram 的 API,使用提供的照片文件 ID 检索文件路径信息。"
      },
      "typeVersion": 1
    },
    {
      "id": "7057a573-4bb7-4b5a-b350-dd64c74f7e4c",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3680,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 176,
        "height": 256,
        "content": "使用来自 Telegram 响应的文件路径构建可下载的文件 URL。"
      },
      "typeVersion": 1
    },
    {
      "id": "92d7a0df-4d7a-4d19-b777-5ec25dac16a9",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3488,
        -480
      ],
      "parameters": {
        "color": 4,
        "width": 192,
        "height": 256,
        "content": "从 Telegram 下载照片文件,并将其存储为 photo_data 供 AI 使用。"
      },
      "typeVersion": 1
    },
    {
      "id": "6802e29d-1ee8-488f-92c3-1ee294f321c6",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3232,
        -480
      ],
      "parameters": {
        "color": 6,
        "height": 256,
        "content": "使用 AI 代理(由语言模型驱动)基于图像、标题和品牌风格提示生成营销内容。"
      },
      "typeVersion": 1
    },
    {
      "id": "5c1608cb-b51e-4e9f-b454-cc12aad1ae89",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3328,
        -160
      ],
      "parameters": {
        "color": 6,
        "height": 256,
        "content": "提供支持 AI Agent 节点生成帖子内容的底层 LLM(如 Gemini 或 GPT)。"
      },
      "typeVersion": 1
    },
    {
      "id": "50ae9451-f18c-42ee-8ab4-b4c18611a1ed",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2944,
        -608
      ],
      "parameters": {
        "color": 4,
        "height": 384,
        "content": "解析来自 AI 的结构化 JSON 响应以提取:"
      },
      "typeVersion": 1
    },
    {
      "id": "305fd517-304a-4f92-9581-a010c1ccc23f",
      "name": "决定输入是新的还是旧的",
      "type": "n8n-nodes-base.switch",
      "position": [
        -2656,
        -368
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "39e6e597-0d27-43c5-bae6-42926f284937",
                    "operator": {
                      "type": "boolean",
                      "operation": "false",
                      "singleValue": true
                    },
                    "leftValue": "={{ $('Check if Message has Photo').item.json.message.from.is_bot }}",
                    "rightValue": ""
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "203ef3ef-d966-45bd-8b30-40c62e3e1fb0",
                    "operator": {
                      "type": "boolean",
                      "operation": "true",
                      "singleValue": true
                    },
                    "leftValue": "={{ $('Check if Message has Photo').item.json.message.from.is_bot }}",
                    "rightValue": ""
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "ae793205-2c10-4640-a9cd-ea6111894cfd",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2688,
        -528
      ],
      "parameters": {
        "color": 5,
        "width": 176,
        "height": 304,
        "content": "检查消息发送者是新消息还是用户请求编辑,并将生成的内容路由到正确的审批流程。"
      },
      "typeVersion": 1
    },
    {
      "id": "da169286-1d7a-4781-a3c0-9f6c3bdf7e01",
      "name": "发送内容以供审批 (新)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -2320,
        -496
      ],
      "webhookId": "872bb540-ea9e-4277-b3ea-e5f8a8a98f6e",
      "parameters": {
        "chatId": "={{ $('Check if Message has Photo').item.json.message.chat.id }}",
        "message": "=📝 **Generated Marketing Content**\n\n**Headline:** {{ $('Parse AI Output').item.json.headline }}\n\n**Content:** {{ $('Parse AI Output').item.json.content }}\n\n**Hashtags:** {{ $('Parse AI Output').item.json.hashtags }}\n\n**CTA:** {{ $('Parse AI Output').item.json.cta }}\n\n✅ Reply \"APPROVE\" to post \n❌ Reply \"REJECT\" to cancel",
        "options": {},
        "operation": "sendAndWait",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "54Wv2uMARWE0XAUl",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "657f641e-539d-4b23-bccc-b83c19f223f7",
      "name": "发送内容以供审批 (旧)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -2320,
        -144
      ],
      "webhookId": "1fb88870-f8aa-4308-a109-ca10769b0040",
      "parameters": {
        "chatId": "={{ $('Extract Telegram Metadata').item.json.chat_id }} ",
        "message": "=📝 **Generated Marketing Content**\n\n**Headline:** {{ $('Parse AI Output').item.json.headline }}\n\n**Content:** {{ $('Parse AI Output').item.json.content }}\n\n**Hashtags:** {{ $('Parse AI Output').item.json.hashtags }}\n\n**CTA:** {{ $('Parse AI Output').item.json.cta }}\n\n✅ Reply \"APPROVE\" to post \n❌ Reply \"REJECT\" to cancel",
        "options": {},
        "operation": "sendAndWait",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "54Wv2uMARWE0XAUl",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6344d872-4c6a-455d-bf07-238dc8344d03",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2368,
        -608
      ],
      "parameters": {
        "color": 4,
        "width": 208,
        "height": 288,
        "content": "将 AI 生成的内容发送给用户审核,并等待他们的回复(批准或拒绝)。"
      },
      "typeVersion": 1
    },
    {
      "id": "ac30bbca-7e8f-4d4a-9923-d381e34c1ccb",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2368,
        -256
      ],
      "parameters": {
        "color": 4,
        "width": 208,
        "height": 288,
        "content": "将 AI 生成的内容发送给用户审核,并等待他们的回复(批准或拒绝)。"
      },
      "typeVersion": 1
    },
    {
      "id": "9059b7fd-018b-46f3-9ab1-d5e9648c07ec",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1952,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 176,
        "height": 256,
        "content": "检查用户是批准还是拒绝了内容,并相应地进行路由。"
      },
      "typeVersion": 1
    },
    {
      "id": "c32046c3-99e2-44b1-a77d-d1b849872cdf",
      "name": "便签13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1712,
        -496
      ],
      "parameters": {
        "color": 4,
        "width": 192,
        "height": 272,
        "content": "使用多部分 HTTP 请求将批准的照片和内容发布到 Facebook 页面。"
      },
      "typeVersion": 1
    },
    {
      "id": "c2f306c7-b762-47e3-b930-cebc61e16b74",
      "name": "便签14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1504,
        -496
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "height": 272,
        "content": "通过 Telegram 通知用户 Facebook 帖子已成功安排或发布。"
      },
      "typeVersion": 1
    },
    {
      "id": "056940d3-d701-4904-a02b-9c9f122e20fd",
      "name": "检查是文本还是照片",
      "type": "n8n-nodes-base.switch",
      "position": [
        -2000,
        96
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "2a8def23-8ef5-470c-96c8-ba873aa48a30",
                    "operator": {
                      "type": "boolean",
                      "operation": "false",
                      "singleValue": true
                    },
                    "leftValue": "={{ $('Check if Message has Photo').item.json.message.from.is_bot }}",
                    "rightValue": ""
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "2011dd2e-5ed8-45c4-887f-01944f6e94a1",
                    "operator": {
                      "type": "boolean",
                      "operation": "true",
                      "singleValue": true
                    },
                    "leftValue": "={{ $('Check if Message has Photo').item.json.message.from.is_bot }}",
                    "rightValue": ""
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "d98de212-9b3c-4917-9120-dfb6d5198244",
      "name": "便签15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2048,
        0
      ],
      "parameters": {
        "color": 4,
        "width": 208,
        "height": 272,
        "content": "检查消息是来自文本路径还是照片路径"
      },
      "typeVersion": 1
    },
    {
      "id": "4669ff74-44b8-4d8e-bb6e-74466a4bc88a",
      "name": "询问用户是否需要更改",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1696,
        80
      ],
      "webhookId": "73490335-a569-4664-b19d-ce2b1abbb89a",
      "parameters": {
        "text": "What changes would you like ?",
        "chatId": "={{ $('Check if Message has Photo').item.json.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "54Wv2uMARWE0XAUl",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6e713890-dc12-4960-b748-37991976f036",
      "name": "便签16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1760,
        -16
      ],
      "parameters": {
        "color": 5,
        "width": 224,
        "height": 256,
        "content": "发送一条 Telegram 消息,要求用户输入他们想要的内容(在没有发送照片时使用)。"
      },
      "typeVersion": 1
    },
    {
      "id": "dccf21dd-f0ff-41fd-a76c-3d34ad6a718d",
      "name": "便签17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        -112
      ],
      "parameters": {
        "color": 4,
        "height": 352,
        "content": "通过使用用户的文本而不是照片再次执行来重新触发工作流。通过 Telegram 启用反馈循环,而不是麻烦用户在新的点击中编写他们的编辑。"
      },
      "typeVersion": 1
    },
    {
      "id": "07331e32-ca71-4ff3-8722-095778bfe351",
      "name": "便签18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1888,
        384
      ],
      "parameters": {
        "color": 4,
        "height": 352,
        "content": "通过使用用户的文本而不是照片再次执行来重新触发工作流。通过 Telegram 启用反馈循环,而不是麻烦用户在新的点击中编写他们的编辑。"
      },
      "typeVersion": 1
    },
    {
      "id": "b58342e6-1131-42be-9a10-ceefa65780a4",
      "name": "便签19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2128,
        448
      ],
      "parameters": {
        "color": 5,
        "width": 224,
        "height": 288,
        "content": "发送一条 Telegram 消息,要求用户输入他们想要的内容(在发送了照片时使用)。"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3c4af25b-1c97-4e1f-8e22-cbf8a0ab92e5",
  "connections": {
    "Parse AI Output": {
      "main": [
        [
          {
            "node": "Decide Input is New or Old",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approval Decision": {
      "main": [
        [
          {
            "node": "Publish Post to Facebook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check If Text or Photo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger from Telegram": {
      "main": [
        [
          {
            "node": "Check if Message has Photo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Text or Photo": {
      "main": [
        [
          {
            "node": "Asking User for Changes",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prompt for User Input (Manual)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Telegram File Info": {
      "main": [
        [
          {
            "node": "Build Telegram Image URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Asking User for Changes": {
      "main": [
        [
          {
            "node": "Restart Workflow Again",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Telegram Image": {
      "main": [
        [
          {
            "node": "Generate Marketing Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Telegram Image URL": {
      "main": [
        [
          {
            "node": "Download Telegram Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish Post to Facebook": {
      "main": [
        [
          {
            "node": "Notify Facebook Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Telegram Metadata": {
      "main": [
        [
          {
            "node": "Get Telegram File Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Message has Photo": {
      "main": [
        [
          {
            "node": "Extract Telegram Metadata",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Marketing Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decide Input is New or Old": {
      "main": [
        [
          {
            "node": "Send Content for Approval (New)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Content for Approval (Old)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Marketing Content": {
      "main": [
        [
          {
            "node": "Parse AI Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Language Model (OpenRouter)": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Marketing Content",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Prompt for User Input (Manual)": {
      "main": [
        [
          {
            "node": "Restart Workflow with User Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Content for Approval (New)": {
      "main": [
        [
          {
            "node": "Approval Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Content for Approval (Old)": {
      "main": [
        [
          {
            "node": "Approval Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
Abdullah Alshiekh

Abdullah Alshiekh

@abdullah01

🚀 Automation pro building AI-powered workflows with n8n. 💼 Special focus on real use cases 🔧 Love clean, flexible, and business-ready automations.

外部链接
在 n8n.io 查看

分享此工作流