8
n8n 中文网amn8n.com

使用 GPT-4 和 Dumpling AI 从 Telegram 创建 LinkedIn 内容

高级

这是一个Miscellaneous, Multimodal AI领域的自动化工作流,包含 16 个节点。主要使用 Set, Switch, Airtable, Telegram, Agent 等节点。 使用 Whisper、GPT-4 和 Dumpling AI 从 Telegram 语音/文本创建 LinkedIn 内容

前置要求
  • Airtable API Key
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "BwphfgLq7SKpdkOy",
  "meta": {
    "instanceId": "a1ae5c8dc6c65e674f9c3947d083abcc749ef2546dff9f4ff01de4d6a36ebfe6",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 GPT-4 和 Dumpling AI 从 Telegram 创建 LinkedIn 内容",
  "tags": [],
  "nodes": [
    {
      "id": "8a311ea8-7047-444e-b389-d2a46321d29a",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        464,
        304
      ],
      "parameters": {
        "sessionKey": "={{ $('Receive Telegram Input').item.json.message.from.username }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "6a7b3fdf-7b5a-4198-9884-34bf8d77a54b",
      "name": "网络搜索工具",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        608,
        336
      ],
      "parameters": {
        "url": "https://app.dumplingai.com/api/v1/search-news",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"query\": \"{{ $fromAI('query') }}\"\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "toolDescription": "Use this tool to do web research"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "RLFzAcGRepr5eXZB",
          "name": "Dumpling AI-n8n"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e3f5b1a4-48c5-4ad0-a3cd-783520d5ccdc",
      "name": "图像生成工具",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        816,
        320
      ],
      "parameters": {
        "url": "https://app.dumplingai.com/api/v1/generate-ai-image",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"FLUX.1-pro\",\n  \"input\": {\n    \"prompt\": \"{{ $fromAI('prompt') }}\",\n    \"seed\": 42,\n    \"steps\": 25,\n    \"width\": 1024,\n    \"height\": 1024,\n    \"guidance\": 3,\n    \"aspect_ratio\": \"1:1\",\n    \"output_format\": \"png\",\n    \"output_quality\": 90,\n    \"safety_tolerance\": 2,\n    \"prompt_upsampling\": false\n  }\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "toolDescription": "Use this tool to generate images"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "RLFzAcGRepr5eXZB",
          "name": "Dumpling AI-n8n"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "06218c34-30c6-4f29-8fb9-4fa2d1ecf2da",
      "name": "接收 Telegram 输入",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -720,
        48
      ],
      "webhookId": "d0ed5025-57ad-4d80-be09-6eb0d355d8b4",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "hv5o1OogajIIiMlt",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d9012129-9395-4174-ad54-4f2b7b6b1d3e",
      "name": "检查消息类型",
      "type": "n8n-nodes-base.switch",
      "position": [
        -496,
        48
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "18d77f22-b692-462b-8d43-34ddc5609c5e",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "audio",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1a355c34-2cf5-4116-98a4-cce7c0f5caa2",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.message.voice.mime_type }}",
                    "rightValue": "audio/ogg"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "8f899c95-272e-4aad-aa5d-f6e1a84aad3e",
      "name": "下载 Telegram 音频",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -272,
        144
      ],
      "webhookId": "d9769ce1-37b1-4f1f-bacd-e5cf5e330f20",
      "parameters": {
        "fileId": "={{ $json.message.voice.file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "hv5o1OogajIIiMlt",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "21654110-4260-4d6f-b948-581f1928763b",
      "name": "将音频转录为文本",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -48,
        144
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe"
      },
      "credentials": {
        "openAiApi": {
          "id": "dd8NvMC6rvx8RITo",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "37fa042f-9a47-4971-9eb3-2ce2b5d5b429",
      "name": "准备转录文本",
      "type": "n8n-nodes-base.set",
      "position": [
        176,
        144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "573add77-32e9-496c-bbbe-99fb8bbe6e6f",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d7b528a6-a57f-4ee4-87d2-9e594b4003fd",
      "name": "提取文本消息",
      "type": "n8n-nodes-base.set",
      "position": [
        288,
        -96
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "2895b578-af52-42fb-b645-d42cb9456fec",
              "name": "text",
              "type": "string",
              "value": "={{ $json.message.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ef871181-d247-4c85-98d8-b88adc8311b1",
      "name": "生成创意、上下文和图像提示",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        656,
        48
      ],
      "parameters": {
        "text": "=user input: {{ $json.text }}",
        "options": {
          "systemMessage": "=System Prompt for n8n Agent\n\nYou are a content creation agent for LinkedIn.\nYou receive an input idea from user input. Your job is to research, generate context, clean the image prompt, and create a related image. Finally, return a JSON object.\n\nWorkflow\n\nResearch ideas\n\nTake the idea from user input.\n\nForm a clear query string to explore the idea further.\n\nCall Web_search_tool with the query.\n\nOnly retrieve and review 3 news results about the topic.\n\nExtract the most relevant points from those 3 results.\n\nFrom this, produce:\n\nideas: a short, clear statement based on the refined research.\n\ncontext: 2–4 sentences that expand on the idea with simple grammar.\n\nPrepare the image prompt\n\nCraft a descriptive visual prompt based on the idea and context.\n\nThe description should include subject, setting, and mood.\n\nOnce the ideas and context are complete, send the crafted prompt to the Code node to clean it.\n\nThe Code node must ensure that the prompt has no new line characters.\n\nThe Code node is only called once per execution, after the ideas and context are finalized.\n\nGenerate an image\n\nAfter cleaning, use the single cleaned string as the input for Image_generation_tool.\n\nCall Image_generation_tool only once per execution.\n\nRequest a professional LinkedIn-ready image.\n\nUse the returned URL as the image.\n\nFinal Output\n\nAlways return the result as a single JSON object in the format below:\n\n{\n  \"ideas\": \"string\",\n  \"context\": \"string\",\n  \"image\": \"URL\"\n}\n\nRules\n\nGrammar must be simple, clear, and professional.\n\nNo emojis.\n\nNo hyphens.\n\nideas is one short refined idea.\n\ncontext is 2–4 sentences explaining the idea.\n\nimage is the direct URL returned by Image_generation_tool.\n\nAlways call the Code node once to clean the image prompt before passing it to the image tool.\n\nThe Image_generation_tool is only called once per execution, after context and ideas are complete.\n\nReturn nothing except the JSON object."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "bd2b04e9-b2a5-478c-8a4c-329a49f818ce",
      "name": "GPT-4 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        336,
        272
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "dd8NvMC6rvx8RITo",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "dac36388-cf7b-439c-8524-7ed45e1fd8fa",
      "name": "将输出格式化为 JSON",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1168,
        272
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"ideas\": \"string\",\n  \"context\": \"string\",\n  \"image\": \"URL\"\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "01130e23-5c3e-4954-b3cd-2615c68c4e0f",
      "name": "清理图像提示",
      "type": "@n8n/n8n-nodes-langchain.toolCode",
      "position": [
        992,
        320
      ],
      "parameters": {
        "jsCode": "// Input comes in as `query`\nlet s = String(query ?? \"\");\n\n// Remove newline and line-separator characters, then collapse spaces\ns = s.replace(/[\\u000A\\u000D\\u2028\\u2029]+/g, \" \");\ns = s.replace(/\\s+/g, \" \").trim();\n\n// Return the cleaned prompt back to the agent\nreturn s;\n",
        "description": "调用此节点以清理提示中的任何换行符"
      },
      "typeVersion": 1.3
    },
    {
      "id": "bfabbd38-486d-425d-ad58-3f54e4f1a7eb",
      "name": "保存到 Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1104,
        48
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "app2L0MDmxtbrFskg",
          "cachedResultUrl": "https://airtable.com/app2L0MDmxtbrFskg",
          "cachedResultName": "Google search ideas"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblGXuRkIuDI1cESV",
          "cachedResultUrl": "https://airtable.com/app2L0MDmxtbrFskg/tblGXuRkIuDI1cESV",
          "cachedResultName": "Table 1"
        },
        "columns": {
          "value": {
            "ideas": "={{ $json.output.ideas }}",
            "context": "={{ $json.output.context }}",
            "Image URL": "={{ $json.output.image }}"
          },
          "schema": [
            {
              "id": "ideas",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "ideas",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "context",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "context",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image URL",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Image URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "hX3wPN3fUWW9Ctx9",
          "name": "Airtable Personal Access Token account 2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "b0998942-3e41-43de-9c30-93534d1236ad",
      "name": "向 Telegram 发送确认",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1312,
        48
      ],
      "webhookId": "c1b6fefe-3cd3-45c5-99e1-ce9bb5f477ec",
      "parameters": {
        "text": "✅ Your content has been created and saved to Airtable.\n  \n - Ideas and context are ready   \n - Image has been generated and attached    \n\nYou can review and approve everything directly in Airtable.  ",
        "chatId": "={{ $('Receive Telegram Input').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "hv5o1OogajIIiMlt",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3e0d23c1-9c4d-4499-8c2a-21072a7fc609",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        -480
      ],
      "parameters": {
        "color": 4,
        "width": 1024,
        "height": 736,
        "content": "## 📌 LinkedIn 内容创作工作流"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {
    "Receive Telegram Input": [
      {
        "json": {
          "message": {
            "chat": {
              "id": 798432877,
              "type": "private",
              "username": "Shopwithjennifer",
              "first_name": "Shopwithjennifer"
            },
            "date": 1757640855,
            "from": {
              "id": 798432877,
              "is_bot": false,
              "username": "Shopwithjennifer",
              "first_name": "Shopwithjennifer",
              "language_code": "en"
            },
            "text": "nano banana and veo 3",
            "message_id": 24
          },
          "update_id": 361830552
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "845a42d0-a02a-4933-a5f8-b993fe6d0b60",
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Generate Idea, Context & Image Prompt",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Web_search_tool": {
      "ai_tool": [
        [
          {
            "node": "Generate Idea, Context & Image Prompt",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4 Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Idea, Context & Image Prompt",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Save to Airtable": {
      "main": [
        [
          {
            "node": "Send Confirmation to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Message Type": {
      "main": [
        [
          {
            "node": "Extract Text Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download Telegram Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Image Prompt": {
      "ai_tool": [
        [
          {
            "node": "Generate Idea, Context & Image Prompt",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text Message": {
      "main": [
        [
          {
            "node": "Generate Idea, Context & Image Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Output as JSON": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Idea, Context & Image Prompt",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Image_generation_tool": {
      "ai_tool": [
        [
          {
            "node": "Generate Idea, Context & Image Prompt",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Receive Telegram Input": {
      "main": [
        [
          {
            "node": "Check Message Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Telegram Audio": {
      "main": [
        [
          {
            "node": "Transcribe Audio to Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Transcribed Text": {
      "main": [
        [
          {
            "node": "Generate Idea, Context & Image Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe Audio to Text": {
      "main": [
        [
          {
            "node": "Prepare Transcribed Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Idea, Context & Image Prompt": {
      "main": [
        [
          {
            "node": "Save to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 杂项, 多模态 AI

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流